package week3;

import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        int random =(int)(Math.random()*100);
        int guess;
        Scanner sc = new Scanner(System.in);
        while(true){
            System.out.println("请输入一个0-100以内的数字");
            guess = sc.nextInt();
            if(guess==random){
                System.out.println("你猜对了");
                break;
            }else if(guess<random){
                System.out.println("小了");
            }else {
                System.out.println("大了");
            }
        }
    }
}
